

import pygame

class Base(pygame.sprite.Sprite):

    def __init__(self,img,over_img=[],bg_size=[]):

        pygame.sprite.Sprite.__init__(self);

        self.actived=True

        if len(over_img)!=0:
            self.over_img=[]

            for item in over_img:
                self.over_img.append(pygame.image.load("images/"+item+".png"))

        # 背景宽高
        if len(bg_size)!=0:
            self.bgW,self.bgH = bg_size[0],bg_size[1]

        self.image = pygame.image.load("images/"+img+".png").convert_alpha()
        self.rect = self.image.get_rect()

        self.mask = pygame.mask.from_surface(self.image)

            